"""
BreakerMove.py

Author: Miles Malerba
Date: 9-20-08
"""

from GameMove import GameMove

class BreakerMove(GameMove):
    """represents a move made by the code breaker"""

    #possible pieces
    RED = 0
    BLUE = 1
    YELLOW = 2
    GREEN = 3
    WHITE = 4
    BLACK = 5

    #look up table to get color strings
    color_lookup = ['Red', 'Blue', 'Yellow', 'Green', 'White', 'Black']
    
    def __init__(self, guess):
        """constructor. takes a list of integers representing the breaker's
           guess. the list should have 4 elements.
        """
        self.pieces = guess
        
    def to_string(self):
        """return a string representation of the breaker's move"""
        result = 'Breaker: '
        for piece in self.pieces:
            result += self.color_lookup[piece] + ' '
        return result

    def get_player(self):
        """get the player that made this move (Breaker)"""
        return 'Breaker'

    def get_color_name(self,piece):
        """return the name of a color"""
        return self.color_lookup[piece]
